import re

a='abc1234erw5523dfe'
a1 = 'abc1234dfe5523dfe'

ret = re.findall('abc(.*)dfe',a)
print(ret)  #['1234erw5523']

ret1 = re.findall('abc(\d*)dfe',a)
print(ret1)  #[]

#----默认贪婪模式，匹配最多的字符串
ret2 = re.findall('abc(.*)dfe',a1)
print(ret2)  #['1234def5523']

#---若想不贪婪，只匹配第一个，加？
ret3 = re.findall('abc(.*?)dfe',a1)
print(ret3)  #['1234']






